#include<stdio.h>
int huan(int x){
	int i=x,t=0,m=x,s=0,n=1;
	do{
	
	    x/=10;
		n*=10;
	}
	
	while(x!=1);
	do{
		m%=10;
		m*=n;
		s+=m;
		i/=10;
		m=i;
		n/=10;
		
	}
	while(i>0);
	return (s);
} 
 int main(){
 	int n,s;
 	scanf("%d",&n);
 	s=huan(n);
 	printf("%d",s);



}
